import { get } from "../mock";

import request from "@/utils/request";
import { AxiosPromise } from "axios";
import {
  StudentComForms,
  StudentComQuery,
  StudentComPageVO,
  StudentComPageResult,
} from "./types";

/**
 * 获取分页数据
 *
 * @param queryParams
 */
export function getStudentComPage(
  queryParams?: StudentComQuery
): AxiosPromise<StudentComPageResult> {
  return request({
    url: "/api/work/workPage",
    method: "get",
    params: queryParams,
  });
}

/**
 * 获取ID集合
 *
 * @param queryParams
 */
export function getStudentComMenuIds(
  queryParams?: StudentComQuery
): AxiosPromise<string[]> {
  return request({
    url: "/api/work/find",
    method: "get",
    params: queryParams,
  });
}

// /**
//  * 获取ID集合
//  *
//  * @param queryParams
//  */
// export function getStudentComMenuIds(id: string): AxiosPromise<string[]> {
//   return request({
//     url: "/api/work/find",
//     method: "post",
//   });
// }

/**
 * 添加
 *
 * @param data
 */
export function addStudentCom(data: StudentComForms) {
  return request({
    url: "/api/work/insert",
    method: "post",
    data: data,
  });
}

/**
 * 更新
 *
 * @param id
 * @param data
 */
export function updateStudentCom(data: StudentComForms) {
  return request({
    url: "/api/work/update",
    method: "put",
    data: data,
  });
}

/**
 * 获取用户ID集合
 *
 * @param queryParams
 */
export function getUserIds(ids: string): AxiosPromise<number[]> {
  return request({
    url: "/api/sys/user/info",
    method: "get",
  });
}
